package com.example.smartmedicalsystem.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Collections;
import java.util.Map;

@RestController
@RequestMapping("/api/ai")
public class AIController {
    @PostMapping("/chat")
    public ResponseEntity<?> chat(@RequestBody Map<String, String> request) {
        String reply = "AI回复：已收到您的症状描述【" + request.get("message")
                + "】，建议多休息并观察症状变化。";
        return ResponseEntity.ok(Collections.singletonMap("reply", reply));
    }
}